﻿

@{

	Layout = null;
}
<script src="@SiteUrl.GetStaticResourceScriptUrl("~/js/wdtree/tree.js")"></script>
<link href="@SiteUrl.GetStaticResourceScriptUrl("~/js/wdtree/tree.css")" rel="stylesheet" />

<style>
	#blwsDiv {
		position: fixed;
		top: 20%;
		left: 10px;
	}

	.dv-left {
		width: 160px;
		float: left;
	}

	.dv-left-tree {
		overflow-y: auto;
		border-radius: 4px;
		background: white;
	}
	.dv-left-title {
		padding: 6px 10px;
		border-bottom: 1px solid transparent;
		border-top-left-radius: 3px;
		border-top-right-radius: 3px;
		border-color: #ddd;
		background-color: white;
	}

	#BLWS {
		float: left;
		background-color: #00a0ea;
		height: 100px;
		padding: 10px;
		color: white;
		margin: 5px 0 0 0;
	}

	#JCJY {
		float: left;
		background-color: #00a0ea;
		height: 140px;
		padding: 10px;
		color: white;
		margin: 5px 0 0 0;
	}

	#YZ {
		float: left;
		background-color: #00a0ea;
		height: 50px;
		padding: 10px;
		color: white;
		margin: 5px 0 0 0;
	}

	.hide {
		display: none;
	}
</style>


<div class="dv-body" id="blwsDiv">
	<div style="float:left">
		<a class="btn  " id="BLWS">历<br />史<br />文<br />书</a>

		<div id="jcjy" class="hide">
			<a class="btn  " id="JCJY" onclick="btn_jcjy()">检<br />验<br />、<br />检<br />查<br />报<br />告</a>
		</div>
		<div id="yz" class="hide">
			<a class="btn  " id="YZ" onclick="btn_yz()">医<br />嘱</a>
		</div>
	</div>
	<div class="dv-left">
		<div class="dv-left-tree" id="wsTreeList" style="background-color:#eee;"></div>
		
	</div>
</div>

<link href="@SiteUrl.GetStaticResourceScriptUrl("~/css/framework-ui.css")" rel="stylesheet" />
<script src="@SiteUrl.GetStaticResourceScriptUrl("~/js/framework-ui.js")"></script>
<script type="text/javascript">

        $(function () {
            $.ajax({
                url: "/MRHomePage/MRHomePage/DiagnosticSave",
                dataType: "json",
                data: { "Code": "YXZ_EMR1001" },
                type: "POST",
                async: false,
                success: function (result) {
                    if (result.length > 0) {
                        if (result[0].Value == 1) {
                            $("#jcjy").removeClass("hide");
                        }
                    }
                }
            });
            $.ajax({
                url: "/MRHomePage/MRHomePage/DiagnosticSave",
                dataType: "json",
                data: { "Code": "YXZ_EMR1002" },
                type: "POST",
                async: false,
                success: function (result) {
                    if (result.length>0) {
                        if (result[0].Value == 1) {
                            $("#yz").removeClass("hide");
                        }
                    }
                }
            });
        });

        function btn_jcjy()
        {
            $.modalOpen({
                id: "Form",
                title: "检验、检查报告",
                url: "/MedicalRecordManage/MedicalRecord/Form?mzzyh=" + "@ViewBag.zyh" + "&type=zy&ryrq=" + "@ViewBag.ryrq",
                width: "900px",
                height: "600px",
                shade: 0,
                btn: ['', '关闭'],
                btnclass: ['', 'btn btn-danger']
            });
        }

        function btn_yz() {
            $.modalOpen({
                id: "Form",
                title: "医嘱",
                url: "/MedicalRecordManage/MedicalRecord/YZForm?zyh=" + "@ViewBag.zyh" + "&type=zy",
                width: "1100px",
                height: "600px",
                shade: 0,
                btn: ['', '关闭'],
                btnclass: ['', 'btn btn-danger']
            })
        }

    $(function () {
        getWSTreeList();
        $(".dv-left").toggle();
        $("#BLWS").click(function () {
            $(".dv-left").toggle();
        });
    });

		function GetQueryValue(queryName) {
			var query = decodeURI(window.location.search.substring(1));//将url转码，如果不是当前地址链接，可以在这里填写需要的链接
			var vars = query.split("&");//分割字符串，将url切割成数组形式的对象
			for (var i = 0; i < vars.length; i++) {
				var pair = vars[i].split("=");//再次分割成数组
				if (pair[0] == queryName) { return pair[1]; }//如果匹配输出结果

			}
			return null;

		}
    function getWSTreeList()
    {
		var blid = GetQueryValue("blid");
        //var bllx = $.request("bllx");
		var blxtmc_yj = GetQueryValue("blxtmc_yj");
        //var blxtmc_yj2 = "@ViewBag.blxtmc_yj";
        $("#wsTreeList").treeview({
            height: 400,
            slimscroll: false,
            showcheck: true,

            //url: "/MedicalRecord/GetWSTreeListIndex?zyh=" + "@ViewBag.zyh"+"&mzh="+"@ViewBag.mzh",
            url: "/MedicalRecord/GetBFTreeListIndex?zyh=" + "@ViewBag.zyh" + "&blxtmc_yj=" +blxtmc_yj,
            onnodedbclick: function (item) {
                if (item.Ex1 != 'p') {
                    $("#blid").val(item.id + "|" + blid);
                    $("#history").trigger("click");
                    //top.top.$.Newtouchtab.addTabWithOutMenu({ name: "病历操作", enName: "", url: "/MedicalRecordManage/MedicalRecord/PreView?blid=" + item.id + "&bllx=" + item.value + "&zyh=" + "@ViewBag.zyh" + "&mzh=" + "@ViewBag.mzh" + "&jzbl=1&blid2=" + blId + "&bllx2=" + bllx + "&blxtmc_yj=" + blxtmc_yj, AppId: "EMR" });
                }
            }
        });
    }

    $(function () {

		$("#wsTreeList").css("height", "400px");
    });
</script>
